while isOnClosedSwitch {
    toggleSwitch()
    moveForward()
}